#include "adddialog.h"
#include "ui_adddialog.h"
#include <QDesktopWidget>

AddDialog::AddDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddDialog)
{
    ui->setupUi(this);
    setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);

#ifdef ANDROID
    //获取设备屏幕大小
    QDesktopWidget* desktopWidget = QApplication::desktop();
    if (desktopWidget)
    {
        QRect screenRect = desktopWidget->screenGeometry();
        int nActScreenX = screenRect.width();
        int nActScreenY = screenRect.height();
        resize(nActScreenX, nActScreenY / 2);
    }
#endif

}

AddDialog::~AddDialog()
{
    delete ui;
}

QString AddDialog::getText() const
{
    return ui->textEdit->toPlainText();
}
